package com.wyzz.hr.action;

import com.wyzz.hr.base.BaseDownloadAction;
import com.wyzz.hr.bo.IInmatchModelBO;
import com.wyzz.hr.pojo.InmatchModel;
import com.wyzz.hr.pojo.Iodef;

public class DownloadModel extends BaseDownloadAction {

	public DownloadModel() {
	}

	public String execute() throws Exception {
		if (immId == null || immId.length() < 1)
			return "error";
		IInmatchModelBO inmatchModelBO = (IInmatchModelBO) getBean("inmatchModelBO");
		InmatchModel inmatchModel = inmatchModelBO.loadObject(immId,
				new String[] { InmatchModel.PROP_IMM_IO });
		Iodef iodef = inmatchModel.getImmIo();
		if (inmatchModel.getImmInputType().equals("excel")
				&& excelModelDownload(inmatchModel))
			return "download";
		else
			return "error";
	}

	public String getImmId() {
		return immId;
	}

	public void setImmId(String immId) {
		this.immId = immId;
	}

	private static final long serialVersionUID = 1L;
	private String immId;
}
